package com.aidex.biz.service.impl;

import java.util.List;

import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.PublishUserMapper;
import com.aidex.biz.domain.PublishUser;
import com.aidex.biz.service.PublishUserService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 发布信息用户操作Service业务层处理
 *
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-04-29
 */
@Service
@Transactional(readOnly = true)
public class PublishUserServiceImpl extends BaseServiceImpl<PublishUserMapper, PublishUser> implements PublishUserService {
    private static final Logger log = LoggerFactory.getLogger(PublishUserServiceImpl.class);

    /**
     * 获取单条数据
     *
     * @param publishUser 发布信息用户操作
     * @return 发布信息用户操作
     */
    @Override
    public PublishUser get(PublishUser publishUser) {
        PublishUser dto = super.get(publishUser);
        return dto;
    }

    /**
     * 获取单条数据
     *
     * @param id 发布信息用户操作id
     * @return 发布信息用户操作
     */
    @Override
    public PublishUser get(String id) {
        PublishUser dto = super.get(id);
        return dto;
    }


    /**
     * 查询发布信息用户操作列表
     *
     * @param publishUser 发布信息用户操作
     * @return 发布信息用户操作
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public List<PublishUser> findList(PublishUser publishUser) {
        return super.findList(publishUser);
    }

    /**
     * 分页查询发布信息用户操作列表
     *
     * @param publishUser 发布信息用户操作
     * @return 发布信息用户操作
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public PageInfo<PublishUser> findPage(PublishUser publishUser) {
        return super.findPage(publishUser);
    }

    /**
     * 保存发布信息用户操作
     *
     * @param publishUser
     * @return 结果
     */
    @Override
    public boolean save(PublishUser publishUser) {
        return super.save(publishUser);
    }


    /**
     * 删除发布信息用户操作信息
     *
     * @param publishUser
     * @return 结果
     */
    @Override
    public boolean remove(PublishUser publishUser) {
        return super.remove(publishUser);
    }

    /**
     * 批量删除发布信息用户操作
     *
     * @param ids 需要删除的发布信息用户操作ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deletePublishUserByIds(String[] ids) {
        return mapper.deletePublishUserByIds(ids);
    }

    /**
     * 获取最大编号
     *
     * @param publishUser 发布信息用户操作
     * @return 结果
     */
    @Override
    public int findMaxSort(PublishUser publishUser) {
        return NumberUtils.nextOrder(mapper.findMaxSort(publishUser));
    }

    @Transactional(readOnly = false)
    @Override
    public Integer deletePublishUserHistory(String publishId) {
        return mapper.deletePublishUserHistory(publishId);
    }
}
